package com.updesignsz.admin.vo.form;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.format.annotation.DateTimeFormat;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.util.Date;


@NoArgsConstructor
@AllArgsConstructor
@Data
public class NewsForm {

    @NotNull(message = "Id不能为空", groups = PutMapping.class)
    private Integer id;

    private String releaseDate;

    @NotNull(message = "新闻不能为空", groups = {PutMapping.class, PostMapping.class})
    private Integer type;

    @NotBlank(message = "新闻标题不能为空", groups = {PutMapping.class, PostMapping.class})
    private String title;

    @NotBlank(message = "新闻内容不能为空", groups = {PutMapping.class, PostMapping.class})
    private String content;

    @NotBlank(message = "新闻图片不能为空", groups = {PutMapping.class, PostMapping.class})
    private String cover;

}
